package com.buddy.sds.auth.oauth2.config;

import com.buddy.sds.auth.oauth2.token.impl.JDBCTokenManager;
import lombok.Data;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Data
@Configuration
@EnableAutoConfiguration
@ConfigurationProperties(prefix = "com.buddy.sds.auth2")
public class OAuth2ConfigProperties {

    /**
     * token过期时间(单位:秒)
     */
    private long tokenExpireSeconds = 3600 * 24;
    /**
     * refreshToken过期时间
     */
    private long refreshTokenExpireSeconds = 3600 * 24 * 30;

    /**
     * 是否每次登录时都覆盖旧的token，从而达到单设备登录效果
     */
    private boolean coverOldToken;

    /**
     * token管理器
     */
    private Class tokenManager = JDBCTokenManager.class;


}
